/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 50529
 Source Host           : localhost
 Source Database       : dmagic_db

 Target Server Type    : MySQL
 Target Server Version : 50529
 File Encoding         : utf-8

 Date: 03/23/2013 10:55:10 AM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `dmagic_advisory_info`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_inquire_info`;
CREATE TABLE `dmagic_inquire_info` (
  `inquireInfoId` bigint(20) NOT NULL,
  `consultant` varchar(20) NOT NULL,
  `consultantCompany` varchar(50) DEFAULT NULL,
  `consultantTel` varchar(20) DEFAULT NULL,
  `consultantEmail` varchar(50) DEFAULT NULL,
  `consultantFax` varchar(20) DEFAULT NULL,
  `consultantAddress` varchar(255) DEFAULT NULL,
  `opinion` longtext,
  `createdOn` datetime DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`inquireInfoId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `dmagic_appuser`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_appuser`;
CREATE TABLE `dmagic_appuser` (
  `appUserId` bigint(20) NOT NULL,
  `userName` varchar(20) DEFAULT NULL COMMENT '用户名',
  `password` varchar(36) DEFAULT NULL COMMENT '密码',
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` date DEFAULT NULL,
  PRIMARY KEY (`appUserId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `dmagic_appuser`
-- ----------------------------
BEGIN;
INSERT INTO `dmagic_appuser` VALUES ('0', 'admin', 'admin', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for `dmagic_appuser_permission`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_appuser_permission`;
CREATE TABLE `dmagic_appuser_permission` (
  `appUserPermissionId` bigint(20) NOT NULL AUTO_INCREMENT,
  `appUserId` bigint(20) NOT NULL COMMENT '用户ID',
  `permissionId` bigint(20) NOT NULL COMMENT '权限ID',
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`appUserPermissionId`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `dmagic_appuser_permission`
-- ----------------------------
BEGIN;
INSERT INTO `dmagic_appuser_permission` VALUES ('1', '0', '0', null, null, null, null, null), ('2', '0', '1', null, null, null, null, null), ('3', '0', '2', null, null, null, null, null), ('4', '0', '3', null, null, null, null, null), ('5', '0', '4', null, null, null, null, null), ('6', '0', '5', null, null, null, null, null), ('7', '0', '6', null, null, null, null, null), ('8', '0', '7', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for `dmagic_company`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_company`;
CREATE TABLE `dmagic_company` (
  `companyId` bigint(20) NOT NULL,
  `companyNo` varchar(20) NOT NULL,
  `companyName` varchar(255) NOT NULL,
  `companyAddress` varchar(255) DEFAULT NULL,
  `companyTel` varchar(20) DEFAULT NULL,
  `companyFax` varchar(20) DEFAULT NULL,
  `companyEmail` varchar(50) DEFAULT NULL,
  `companyUrl` varchar(50) DEFAULT NULL,
  `companyInfo` longtext DEFAULT NULL,
  `languageId` bigint(20) NOT NULL,
  `flag` tinyint(1) NOT NULL COMMENT '0 is contactup and 1 is aboutus',
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`companyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `dmagic_heat_map`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_heat_map`;
CREATE TABLE `dmagic_heat_map` (
  `heatMapId` bigint(20) NOT NULL,
  `linkedHeatMapId` bigint(20) NOT NULL,
  `heatMapStatus` tinyint(1) DEFAULT NULL,
  `fileInfoId` bigint(20) DEFAULT NULL,
  `uploadFileInfoId` bigint(20) DEFAULT NULL,
  `heatMapDesc` varchar(2000) DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime NOT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime NOT NULL,
  PRIMARY KEY (`heatMapId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
--  Table structure for `dmagic_linked_heat_map`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_linked_heat_map`;
CREATE TABLE `dmagic_linked_heat_map` (
  `linkedHeatMapId` bigint(20) NOT NULL,
  `linkedHeatMapLinkedId` bigint(20) DEFAULT NULL,
  `linkedHeatMapStatus` tinyint(1) DEFAULT NULL,
  `linkedHeatMapType` int(4) DEFAULT NULL COMMENT '0 is news, 1 is product, 2 is successful case',
  `isObsoleteDate` datetime DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime NOT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime NOT NULL,
  PRIMARY KEY (`linkedHeatMapId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
--  Table structure for `dmagic_idgenerator`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_idgenerator`;
CREATE TABLE `dmagic_idgenerator` (
  `GEN_TABLE_NAME` varchar(30) NOT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `GEN_TABLE_VALUE` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `dmagic_idgenerator`
-- ----------------------------
BEGIN;
INSERT INTO `dmagic_idgenerator` VALUES  ('ProductCategory', '1', '11');
COMMIT;
-- ----------------------------
--  Table structure for `dmagic_language`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_language`;
CREATE TABLE `dmagic_language` (
  `languageId` bigint(20) NOT NULL,
  `languageName` varchar(50) NOT NULL COMMENT 'Chinese, English',
  `languageKey` varchar(10) DEFAULT NULL COMMENT 'zh_CN, en_US',
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`languageId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `dmagic_language`
-- ----------------------------
BEGIN;
INSERT INTO `dmagic_language` VALUES ('1', 'English', 'en', null, null, null, null, null), ('2', 'Chinese Traditional', 'zh', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for `dmagic_news`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_news`;
CREATE TABLE `dmagic_news` (
  `newsId` bigint(20) NOT NULL,
  `newsNo` varchar(20) DEFAULT NULL COMMENT '新闻编号',
  `newsTitle` varchar(255) DEFAULT NULL COMMENT '新闻标题',
  `newsStatus` tinyint(1) DEFAULT NULL COMMENT '审核状态',
  `newsDesc` varchar(255) DEFAULT NULL COMMENT '新闻描述',
  `newsContent` longtext COMMENT '新闻内容',
  `newsDate` datetime DEFAULT NULL COMMENT '新闻日期',
  `isTop` tinyint(1) DEFAULT NULL COMMENT '是否置顶',
  `languageId` bigint(20) DEFAULT NULL,
  `uploadFileSetInfoId` bigint(20) DEFAULT NULL COMMENT '附件',
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`newsId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `dmagic_permission`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_permission`;
CREATE TABLE `dmagic_permission` (
  `permissionId` bigint(20) NOT NULL,
  `permissionName` varchar(255) DEFAULT NULL COMMENT '权限名字',
  `permissionDesc` varchar(255) DEFAULT NULL COMMENT '权限描述',
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` date DEFAULT NULL,
  PRIMARY KEY (`permissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `dmagic_permission`
-- ----------------------------
BEGIN;
INSERT INTO `dmagic_permission` VALUES ('0', 'ROLE_ADMIN', 'ADMIN', null, null, null, null, null), ('1', 'ROLE_SuccessfulCasesClassification', '成功案例分类', null, null, null, null, null), ('2', 'ROLE_ProductServiceClassification', '产品服务分类', null, null, null, null, null), ('3', 'ROLE_ProductManager', '产品管理', null, null, null, null, null), ('4', 'ROLE_NewsDynamic', '新闻动态', null, null, null, null, null), ('5', 'ROLE_SuccessfulCasesManager', '成功案例管理', null, null, null, null, null), ('6', 'ROLE_AboutUs', '关于我们', null, null, null, null, null), ('7', 'ROLE_ContactUs', '联系我们', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for `dmagic_product`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_product`;
CREATE TABLE `dmagic_product` (
  `productId` bigint(20) NOT NULL,
  `productNo` varchar(255) DEFAULT NULL COMMENT '产品编号',
  `productModel` varchar(255) DEFAULT NULL COMMENT '产品型号',
  `productName` varchar(255) DEFAULT NULL COMMENT '产品名字',
  `productCategoryId` bigint(20) DEFAULT NULL COMMENT '产品类别',
  `productStatus` tinyint(1) DEFAULT NULL COMMENT '审核状态',
  `productContent` longtext COMMENT '产品详细描述',
  `productDate` datetime DEFAULT NULL COMMENT '产品日期',
  `uploadFileSetInfoId` bigint(20) DEFAULT NULL COMMENT '产品图片',
  `isTop` tinyint(1) DEFAULT NULL COMMENT '是否置顶',
  `languageId` bigint(20) DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`productId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
--  Table structure for `dmagic_successful_case`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_successful_case`;
CREATE TABLE `dmagic_successful_case` (
  `successfulCaseId` bigint(20) NOT NULL,
  `successfulCaseNo` varchar(255) DEFAULT NULL COMMENT '成功案例编号',
  `successfulCaseModel` varchar(255) DEFAULT NULL COMMENT '成功案例型号',
  `successfulCaseName` varchar(255) DEFAULT NULL COMMENT '成功案例名字',
  `successfulCaseCategoryId` bigint(20) DEFAULT NULL COMMENT '成功案例类别',
  `successfulCaseStatus` tinyint(1) DEFAULT NULL COMMENT '审核状态',
  `successfulCaseContent` longtext COMMENT '成功案例详细描述',
  `successfulCaseDate` datetime DEFAULT NULL COMMENT '成功案例日期',
  `uploadFileSetInfoId` bigint(20) DEFAULT NULL COMMENT '成功案例图片',
  `isTop` tinyint(1) DEFAULT NULL COMMENT '是否置顶',
  `languageId` bigint(20) DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`successfulCaseId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
--  Table structure for `dmagic_product_category`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_product_category`;
CREATE TABLE `dmagic_product_category` (
  `productCategoryId` bigint(20) NOT NULL,
  `categoryName` varchar(255) NOT NULL COMMENT '产品类别名',
  `categoryNo` varchar(255) DEFAULT NULL COMMENT '产品类别code',
  `categoryType` tinyint(4) DEFAULT NULL COMMENT '类别分类',
  `parentCategoryId` bigint(20) DEFAULT NULL COMMENT '父类别',
  `languageId` bigint(20) DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime DEFAULT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  PRIMARY KEY (`productCategoryId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- ----------------------------
--  Records of `dmagic_product_category`
-- ----------------------------
BEGIN;
INSERT INTO `dmagic_product_category` VALUES ('1', '服務', null, '0', null, '2', 'admin', '2013-04-21 16:22:44', 'admin', '2013-04-21 16:22:44', null), ('2', '產品', null, '1', null, '2', 'admin', '2013-04-21 16:22:44', 'admin', '2013-04-21 16:22:44', null), ('3', 'Services', null, '0', null, '1', 'admin', '2013-04-21 16:22:44', 'admin', '2013-04-21 16:22:44', null), ('4', 'Product', null, '1', null, '1', 'admin', '2013-04-21 16:22:44', 'admin', '2013-04-21 16:22:44', null), ('5', '商業機構', null, '3', null, '2', 'admin', '2013-04-21 16:29:43', 'admin', '2013-04-21 16:29:45', null), ('6', '商鋪', null, '3', null, '2', 'admin', '2013-04-21 16:36:03', 'admin', '2013-04-21 16:36:16', null), ('7', '政府/非牟利機構', null, '3', null, '2', 'admin', '2013-04-21 16:36:06', 'admin', '2013-04-21 16:36:19', null), ('8', 'Business Organizations', null, '3', null, '1', 'admin', '2013-04-21 16:36:09', 'admin', '2013-04-21 16:36:22', null), ('9', 'Shops', null, '3', null, '1', 'admin', '2013-04-21 16:36:12', 'admin', '2013-04-21 16:36:24', null), ('10', 'Government/Non-profit Institutions', null, '3', null, '1', 'admin', '2013-04-21 16:36:14', 'admin', '2013-04-21 16:36:27', null);
COMMIT;
-- ----------------------------
--  Table structure for `dmagic_upload_file_info`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_upload_file_info`;
CREATE TABLE `dmagic_upload_file_info` (
  `uploadFileInfoId` bigint(20) NOT NULL,
  `location` varchar(500) NOT NULL,
  `fileName` varchar(100) NOT NULL,
  `fileSize` bigint(20) DEFAULT NULL,
  `fileType` varchar(10) DEFAULT NULL,
  `fileEncoding` varchar(100) DEFAULT NULL,
  `fileDesc` varchar(2000) DEFAULT NULL,
  `clientHostName` varchar(50) DEFAULT NULL,
  `isMainFile` tinyint(1) DEFAULT NULL,
  `uploadFileSetInfoId` bigint(20) NOT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime NOT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime NOT NULL,
  PRIMARY KEY (`uploadFileInfoId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `dmagic_upload_fileset_info`
-- ----------------------------
DROP TABLE IF EXISTS `dmagic_upload_fileset_info`;
CREATE TABLE `dmagic_upload_fileset_info` (
  `uploadFileSetInfoId` bigint(20) NOT NULL,
  `fileSetStatus` varchar(50) DEFAULT NULL,
  `isObsoleteDate` datetime DEFAULT NULL,
  `createdBy` varchar(20) DEFAULT NULL,
  `createdOn` datetime NOT NULL,
  `modifiedBy` varchar(20) DEFAULT NULL,
  `modifiedOn` datetime NOT NULL,
  PRIMARY KEY (`uploadFileSetInfoId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

SET FOREIGN_KEY_CHECKS = 1;
